<template>
    <div>
        当前模式：{{ appStore.getDarkMode }}
        <Button @click="toggleDarkMode">点击切换主题</Button>
    </div>
</template>
<script lang='ts' setup>
import { ThemeEnum } from "@/enums/appEnum";
import { useAppStore } from "@/stores/modules/app";
import { Button } from "ant-design-vue";
const appStore = useAppStore();

function toggleDarkMode() {
    const darkMode = (appStore.getDarkMode === ThemeEnum.LIGHT ? ThemeEnum.DARK : ThemeEnum.LIGHT);
    console.log(darkMode)
    appStore.setDarkMode(darkMode);
}
</script>